
-- Menu Class
-- Used to show the initial menu for the player with an Start and Credits options.

menu = {
  background = love.graphics.newImage("images/menu/menu.png"),
  backgroundWidth = 720,
  backgroundHeight = 570,
  
  -- Buttons on the menu
  startButtonX = 50,
  startButtonY = 55,
  creditButtonX = 50,
  creditButtonY = 125,
  
  buttonWidth = 145,
  buttonHeight = 55
}

function menu:load()
  
end

function menu:draw()
  love.window.setMode(menu.backgroundWidth, menu.backgroundHeight)
  love.graphics.draw(menu.background, 0, 0)
end

function menu:update(dt)
  
end

function menu:mouseInButton(mouseX, mouseY, buttonX, buttonY, buttonWidth, buttonHeight)
    return mouseX > buttonX and mouseY > buttonY and mouseX < buttonX + buttonWidth and mouseY < buttonY + buttonHeight
end

function menu:startButtonClicked(mouseX, mouseY, button)
  if(button == "l" and menu:mouseInButton(mouseX, mouseY, menu.startButtonX, menu.startButtonY, menu.buttonWidth, menu.buttonHeight)) then
    return true
  end
end

function menu:creditsButtonClicked(mouseX, mouseY, button)
  if(button == "l" and menu:mouseInButton(mouseX, mouseY, menu.creditButtonX, menu.creditButtonY, menu.buttonWidth, menu.buttonHeight)) then
    return true
  end
end